//
//  Thread.m
//  Study
//
//  Created by 振兴 刘 on 2017/9/27.
//  Copyright © 2017年 振兴 刘. All rights reserved.
//

#import "Thread.h"

@implementation Thread

+ (void)createGCDThread {
    
    //dispatch_queue_t queue = dispatch_queue_create("gcd", DISPATCH_QUEUE_CONCURRENT);
    
    dispatch_time_t time = dispatch_time(DISPATCH_TIME_NOW, 2*NSEC_PER_SEC);
    
    dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
    
    dispatch_after(time, queue, ^{
        dispatch_async(dispatch_get_main_queue(), ^{
            
        });
    });
}

+ (void)createOperationThread {
    
    NSOperationQueue * queue = [[NSOperationQueue alloc] init];
    queue.maxConcurrentOperationCount = 10;
    
    [queue addOperationWithBlock:^{
        
    }];
    
//    NSBlockOperation* block = [[NSBlockOperation alloc] addExecutionBlock:^{
//
//    }];
}

@end
